# 使用等差数列求和1~100的总和(高斯求和)

# 定义两个变量,用于接收用户的开始数字和结束数字的输入

starting = eval(input("Please enter the starting number:"))

ending = eval(input("Please enter the ending number:"))

# 高斯等差数列公式 (开始 + 结束) * (结束 - 开始 + 1) / 2
sums = (starting + ending)*(ending - starting + 1) / 2
print(f"from {starting} to {ending} total sum is {sums}")
